<?php


class SvcLogConnected extends SvcCommun {
    
    
    private static $list=false;
    private static $show=false;
    
    
    
    public static function verifier(){
	
	if(!Security::isConnected()){
	    Security::notAllowedPage();
	}
	
	$show=Form::getParam('show');
	$download=Form::getParam('download');
	$delete=Form::getParam('delete');
	
	if($show){
	    self::$show=$show;
	    self::$title=$show;
	}
	elseif($download){
	    self::download($download);
	}
	else{
	    if($delete){
		FileSystem::deleteFile('data/logs/'.$delete);
	    }
	    self::$list=true;
	    self::$title='Journal des logs';
	}

    }
    
    
    public static function listLogs(){
	return self::$list;
    }
    
    public static function showLog(){
	return self::$show;
    }
    
    public static function download($file){
	$file='data/logs/'.$file;
	Download::send($file);
    }
    
    public static function lister(){
	return self::$list==true;
    }
    
    
}


?>